package com.xca.znb.presenter;

import com.xca.znb.entity.Cart;
import com.xca.znb.entity.Goods;
import com.xca.znb.model.imodel.IShoppingCart;

import java.util.List;

public class ShoppingCartPresenter {
    private IShoppingCart iShoppingCart ;
    public ShoppingCartPresenter(IShoppingCart iShoppingCart){
        this.iShoppingCart = iShoppingCart ;
    }

    public List<Cart> getCartByPhone(String user) {
        return iShoppingCart.getCartByPhone(user);
    }

    public void deleteCartById(int id) {
        iShoppingCart.deleteCartById(id);
    }

    public Cart getCartById(int id) {
        return iShoppingCart.getCartById(id);
    }

    public void updateCartNumById(int id, int num) {
        iShoppingCart.updateCartNumById(id, num);
    }

    public Goods getGoodsById(int id) {
        return iShoppingCart.getGoodsById(id);
    }
    public int getLocalDefaultId(String phone) {
        return iShoppingCart.getLocalDefaultId(phone);
    }
    public void addOrUpdateFoot(int goodsId, String user, String time) {
        iShoppingCart.addOrUpdateFoot(goodsId,user,time);
    }
}
